﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="login" Then
	call login
else
	call index
end if
end Function



Function index
	dim page,aid,rs,sql
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
	dim  rs2,sql2,Runtxt,classid,i
    		classid = Request("classid")
    		If classid = "" Then classid = 0
   		If Not IsNumeric(classid) Then classid = 0
    		classid = CLng(classid)
    		If classid < 0 Then classid = 0
    		aid = Request("aid")      '当前页数
    		If aid = "" Then aid = 1
   		If Not IsNumeric(aid) Then aid = 1
    		aid = CLng(aid)
    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1
	Runtxt=qingtian.RunStr

		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 *  FROM qingtian_phoneurl where id="&aid&""
		rs.open sql,conn,1,1
		if not (rs.eof and rs.bof) then
%>
	<card title="编辑连接地址"><p align="left">
编辑软件连接地址.
<br/>----------------<br/>
   	支持平台:<br/>
	<%
	  set rs2=server.CreateObject("adodb.recordset")
	  sql2="select id,name from qingtian_phonecha where id="&rs("bid")&""
	  rs2.open sql2,conn,1,1
	  if not (rs2.bof and rs2.eof) then
%>
		<select name="bid<%=Runtxt%>" value="<%=rs2("id")%>">
		<option value="<%=rs2("id")%>"><%=qingtian.utf8(rs2("name"))%></option>
                <option value="0">支持所有平台</option>
<%
           else
%>
		<select name="bid<%=Runtxt%>" value="0">
                <option value="0">支持所有平台</option>
<%
           end if
	  Rs2.close
	  sql2="select id,name from qingtian_phonecha where id<>"&rs("bid")&""
	  rs2.open sql2,conn,1,1
	  if not (rs2.bof and rs2.eof) then
	  For i=1 to rs2.RecordCount
		%>
		<option value="<%=rs2("id")%>"><%=qingtian.utf8(rs2("name"))%></option>
		<%
	  Rs2.MoveNext
	  Next

	  end if
	  Rs2.close
	  set rs2=nothing
	%>
	</select><br/>
	软件地址:<br/>
	<input emptyok="true"  name="Fileurl<%=Runtxt%>"  value="<%=rs("Fileurl")%>" type="text"/><br/>
	软件格式:<br/>
	<input emptyok="true"  name="Fileext<%=Runtxt%>"  value="<%=rs("Fileext")%>" type="text"/><br/>
	软件大小:<br/>
	<input emptyok="true"  name="Filesize<%=Runtxt%>"  value="<%=rs("Filesize")%>" type="text"/><br/>
	<anchor>确定提交
    	<go href="editphoneurl.asp?Action=login&amp;classid=<%=classid%>&amp;page=<%=page%>&amp;id=<%=id%>&amp;aid=<%=aid%>&amp;sid=<%=sid%>" method='post'>
        <postfield name="bid" value="$(bid<%=Runtxt%>)"/>
        <postfield name="Fileurl" value="$(Fileurl<%=Runtxt%>)"/>
        <postfield name="Fileext" value="$(Fileext<%=Runtxt%>)"/>
        <postfield name="Filesize" value="$(Filesize<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>----------------<br/>
<a href='editfilelist2.asp?classid=<%=classid%>&amp;page=<%=page%>&amp;id=<%=id%>&amp;sid=<%=sid%>'>返回上级</a><br/>		
<a href='filelist.asp?classid=<%=classid%>&amp;page=<%=page%>&amp;sid=<%=sid%>'>返回下载管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
		end if
		rs.Close
		Set rs = Nothing
End Function
Function login
	dim page,aid,i,rs2,sql2,id
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
	aid=Request.QueryString("aid")
	if aid="" then aid=1
	if not isnumeric(aid) then aid=1
	aid=clng(aid)
		dim rs,sql,errs,classid,fleg,Path,txtid
    		classid = Request("classid")
    		If classid = "" Then classid = 0
   		If Not IsNumeric(classid) Then classid = 0
    		classid = CLng(classid)
    		If classid < 0 Then classid = 0
    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1
		dim bid,fileurl,fileext,filesize
        bid=TRim(Request.form("bid"))
 	fileext=TRim(Request.Form("fileext"))
	filesize=TRim(Request.Form("filesize"))
	fileurl=TRim(Request.Form("fileurl"))
		errs=""
	if bid=""  then errs=errs&"平台分类不能为空<br/>"
	if fileurl=""  then errs=errs&"下载地址不能为空<br/>"
	if fileext=""  then errs=errs&"格式不能为空<br/>"
	if filesize=""  then errs=errs&"大小不能为空<br/>"
	%>
	<card id="login" title="编辑连接地址"><p align="left">
	<%
	IF len(errs)=0 then
		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 *  FROM qingtian_phoneurl where id="&aid&""
		rs.open sql,conn,1,3
                if not (rs.bof and rs.eof)  then
			rs("bid")=clng(bid)
			rs("fileext")=fileext
			rs("filesize")=filesize
			rs("fileurl")=fileurl
		rs.update()
                end if
		rs.Close
		Set rs = Nothing
		%>内容编辑成功,继续编辑连接地址.<br/><a href='editfilelist2.asp?classid=<%=classid%>&amp;page=<%=page%>&amp;id=<%=id%>&amp;sid=<%=sid%>'>返回地址管理</a><br/>
<%

	else%>
		<%=errs%>
		<a href='editphoneurl.asp?classid=<%=classid%>&amp;page=<%=page%>&amp;aid=<%=aid%>&amp;id=<%=id%>&amp;sid=<%=sid%>'>返回继续编辑</a><br/>
<%	end if
%>----------------<br/>		
<a href='filelist.asp?classid=<%=classid%>&amp;page=<%=page%>&amp;sid=<%=sid%>'>返回下载管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


%>
